# 
# Created by francklinson on 2021/7/31 AT 9:51.
#
from typing import List


class Solution:
    def generate(self, numRows: int) -> List[List[int]]:
        # 生成前n行的杨辉三角
        ans = []
        for i in range(numRows):
            level = [1 for _ in range(i + 1)]
            for j in range(1, i):
                level[j] = ans[i - 1][j - 1] + ans[i - 1][j]
            ans.append(level)
        return ans


if __name__ == '__main__':
    sol = Solution()
    print(sol.generate(5))
